<div class="panel panel-box">
    <div class="panel-heading">
            <h3 class="panel-title">
                <?php echo yii::t('models/Teaching','Download')?>
            </h3>
    </div>
    <ul class="list-group">
        <?php for($i = 0;$i < ((count($this->resources) > 5) ? 5 : count($this->resources));$i++):?>
        <li class="list-group-item">
        <span class="glyphicon glyphicon-download"></span>
        <a class="teachingResourcesDownloadItem" data-toggle="modal" data-target="#downloadModalBox" style="cursor:pointer" 
            resources="<?php echo $this->resources[$i]->resources_id;?>" teaching="<?php echo $this->teachingModel->teaching_id;?>"
            actionUrl="<?php echo yii::app()->baseUrl.'/'.yii::app()->controller->id.'/'.yii::app()->controller->getAction()->getId();?>">
                <?php $elem = $this->resources[$i]->getTeachingResourceModel($this->teachingModel->teaching_id);?>
                <?php echo CHtml::encode($elem->title);?>
            </a>
                <div class="pull-right"><?php echo '上传时间 : '.date('Y-m-d',strtotime($this->resources[$i]->create_date))?></div>
                <div class="pull-right" style="padding-right:10px"><?php echo '上传用户 : '.$this->resources[$i]->user->user_name;?> </div>
                <div class="pull-right" style="padding-right:10px"><?php echo '下载次数 : '.$this->resources[$i]->download_count;?> </div>
        </li>
        <?php endfor;?>
    </ul>
</div>
<div class="modal fade" id="downloadModalBox" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:50%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel"><?php echo yii::t('models/Teaching','Teaching Resources Download');?></h4>
      </div>
      <div class="modal-body">
        <div class="jumbotron">
            <h3 id="downloadTitle">123</h3>
            <span id="downloadContent"></span>
            <form method="post">
            <p><button name="Download" id="downloadButton" type="submit" class="pull-right btn btn-primary btn-lg" role="button">Download</button></p>
            </form>
        </div>
      </div>
    </div>
  </div>
</div>


